<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>void类型</title>
</head>
<body>

    <br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br>
    <script type="text/javascript">

        function fun() {
            console.log("执行回调函数");
        }
        window.onload = function() {
            var el = document.getElementById("id1");
            el.onclick = fun;
        }
    </script>

    <a href="javascript:void(0)" id="id1" onclick="">advjbadcbka</a>
</body>
</html>